import { View } from "../../../../mvc/core/View";
import { IToolTipItem } from "../../../../../com/mui/manager/IToolTipItem";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { LoaderHelp } from "../../../../common/display/LoaderHelp";
import { ResFileConst } from "../../../resource/ResFileConst";
import { ToolTipsManager } from "../../../../../com/mui/manager/ToolTipsManager";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class PlayerRuneFight
    
    export  class PlayerRuneFight extends View implements IToolTipItem
    {
        constructor()
        {
            super();
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ObjCreate.createBg(0, 0, 135, 46, this);
            this._runeFightBmp = new Object /* flash.display.Bitmap */();
            this._runeFightBmp.x = 35;
            this._runeFightBmp.y = 2;
            addChild(this._runeFightBmp);
            ObjCreate.createBg(10, 21, 122, 22, this, ImagesConst.SelectedBg);
            this._runeFightIcon = new Object /* flash.display.Bitmap */();
            this._runeFightIcon.x = 20;
            this._runeFightIcon.y = 21;
            addChild(this._runeFightIcon);
            this._runeFightTxt = ObjCreate.createGTextField("--", 35, 23, 60, 20, this, new GTextFormat(FontUtil.songtiName, 14, 15788607));
            this._runeFightTxt.autoSize = flash.text.TextFieldAutoSize.CENTER;
            LoaderHelp.addResCallBack(ResFileConst.player, this.onResLoaded);
            ToolTipsManager.register(this);
            return;
        }

        /* internal  */onResLoaded(): void
        {
            this._runeFightBmp.bitmapData = GlobalClass.getBitmapData(ImagesConst.RuneFightValue);
            this._runeFightIcon.bitmapData = GlobalClass.getBitmapData(ImagesConst.RuneFightIcon);
            return;
        }

        public updateRuneFight(arg1: string): void
        {
            this._runeFightTxt.text = arg1;
            return;
        }

        public get toolTipData()
        {
            return this._toolTipData;
        }

        public set toolTipData(arg1)
        {
            if (arg1 == null || arg1 == "") 
            {
                ToolTipsManager.unregister(this);
            }
            else 
            {
                ToolTipsManager.register(this);
            }
            this._toolTipData = arg1;
            return;
        }

        /* internal */ /* var */_runeFightBmp: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_runeFightIcon: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_runeFightTxt: GTextFiled;

        /* internal */ /* var */_toolTipData;
    }
